//file:TransportLib\ProtocolLib.cpp
#include "ProtocolLib.h"
#include <windows.h>

CKPacket::CKPacket(PPROTOCOLHEADER pProtocolHeader, void *pProtocolBody, int dwBodySize)
{	
	m_dwBodySize = dwBodySize;
	memcpy(&m_ProtocolHeader, pProtocolHeader, sizeof(PROTOCOLHEADER));
	m_pProtocolBody = ::GlobalAlloc(GPTR, dwBodySize);
	memcpy(this->m_pProtocolBody, pProtocolBody, dwBodySize);
}


CKPacket::CKPacket(CKPacket &packet)
{
	CKPacket(&(packet.m_ProtocolHeader), packet.m_pProtocolBody, packet.m_dwBodySize);
}

CKPacket::~CKPacket()
{
	
}


CKPacket& CKPacket::operator =(const CKPacket &packet)
{
	CKPacket(&(packet.m_ProtocolHeader), packet.m_pProtocolBody, packet.m_dwBodySize);
	return *this;
}